{{!

  Copyright (c) Meta Platforms, Inc. and affiliates.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

}}{{!
Generated Python classes for Thrift clients
}}
{{> common/auto_generated_py}}
import builtins


import typing as _typing
import types as _py_types

import apache.thrift.metadata.thrift_types as _fbthrift_metadata
import folly.iobuf as _fbthrift_iobuf
from {{program:base_library_package}}.client import (
    AsyncClient as _fbthrift_python_AsyncClient,
    SyncClient as _fbthrift_python_SyncClient,
    Client as _fbthrift_python_Client,
)
from {{program:base_library_package}}.client.omni_client import InteractionMethodPosition as _fbthrift_InteractionMethodPosition, FunctionQualifier as _fbthrift_FunctionQualifier
{{#program:has_sink_functions?}}
from {{program:base_library_package}}.streaming.sink import ClientSink as _fbthrift_ClientSink
{{/program:has_sink_functions?}}
from {{program:base_library_package}}.common import RpcOptions{{!
}}{{#program:generate_mutable_types}}
import {{program:base_library_package}}.mutable_containers as _fbthrift_python_mutable_containers
import {{program:base_library_package}}.mutable_exceptions as _fbthrift_python_mutable_exceptions
import {{program:base_library_package}}.mutable_types as _fbthrift_python_mutable_types{{!
}}{{/program:generate_mutable_types}}
import {{program:base_library_package}}.exceptions as _fbthrift_python_exceptions
import {{program:base_library_package}}.types as _fbthrift_python_types
import {{program:module_path}}.{{> types/types_import_path}} as {{program:module_mangle}}__{{> types/types_import_path}}
import {{program:module_path}}.thrift_metadata as {{program:module_mangle}}__thrift_metadata
{{#program:include_namespaces}}
{{#has_types?}}
import {{included_module_path}}.{{> types/types_import_path}} as {{included_module_mangle}}__{{> types/types_import_path}}
{{/has_types?}}
{{#has_services?}}
{{#program:generate_immutable_types}}
import {{included_module_path}}.thrift_clients
{{/program:generate_immutable_types}}
{{#program:generate_mutable_types}}
import {{included_module_path}}.thrift_mutable_clients
{{/program:generate_mutable_types}}
{{/has_services?}}
{{/program:include_namespaces}}
{{#program:adapter_modules}}
import {{module_path}}
{{/program:adapter_modules}}
{{#program:adapter_type_hint_modules}}
import {{module_path}}
{{/program:adapter_type_hint_modules}}
{{#program:services?}}
{{#program:services}}

class {{service:name}}(_fbthrift_python_Client["{{service:name}}.Async", "{{service:name}}.Sync"]):
    annotations = _py_types.MappingProxyType({
        {{#service:annotations}}
            {{> common/annotation}}
            {{#last?}}

            {{/last?}}
        {{/service:annotations}}
    })
    {{> clients/client_body }}

{{#service:interactions}}
class {{service:parent_service_name}}_{{service:name}}(_fbthrift_python_Client["{{service:parent_service_name}}_{{service:name}}.Async", "{{service:parent_service_name}}_{{service:name}}.Sync"]):
    {{> clients/client_body }}

{{/service:interactions}}
{{/program:services}}
{{/program:services?}}
